import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart';
import 'package:flutterjc/plugin/ActionChipPlugin.dart';
import 'package:flutterjc/plugin/AliginPlugin.dart';
import 'package:flutterjc/plugin/AppBarPlugin.dart';
import 'package:flutterjc/plugin/AspectD/AspectDPlugin.dart';
import 'package:flutterjc/plugin/BlocPlugin.dart';
import 'package:flutterjc/plugin/BottomAppBarPlugin.dart';
import 'package:flutterjc/plugin/BottomSheetPlugin.dart';
import 'package:flutterjc/plugin/ButtonBarPlugin.dart';
import 'package:flutterjc/plugin/CardPlugin.dart';
import 'package:flutterjc/plugin/CheckboxListTilePlugin.dart';
import 'package:flutterjc/plugin/CheckboxPlugin.dart';
import 'package:flutterjc/plugin/ChipPlugin.dart';
import 'package:flutterjc/plugin/ChooseChipPlugin.dart';
import 'package:flutterjc/plugin/ClipRRectPlugin.dart';
import 'package:flutterjc/plugin/ColumnPlugin.dart';
import 'package:flutterjc/plugin/DataTablePlugin.dart';
import 'package:flutterjc/plugin/DialogPlugin.dart';
import 'package:flutterjc/plugin/DividerPlugin.dart';
import 'package:flutterjc/plugin/EventBusPlugin.dart';
import 'package:flutterjc/plugin/ExpandPlugin.dart';
import 'package:flutterjc/plugin/ExpansionPanelPlugin.dart';
import 'package:flutterjc/plugin/FilterChipPlugin.dart';
import 'package:flutterjc/plugin/FromPlugin.dart';
import 'package:flutterjc/plugin/GridViewPlugin.dart';
import 'package:flutterjc/plugin/HttpPlugin.dart';
import 'package:flutterjc/plugin/IconFontPlugin.dart';
import 'package:flutterjc/plugin/InputChipPlugin.dart';
import 'package:flutterjc/plugin/ContainerPlugin.dart';
import 'package:flutterjc/plugin/ListViewPlugin.dart';
import 'package:flutterjc/plugin/LocalePlugin.dart';
import 'package:flutterjc/plugin/NotificationsPlugin.dart';
import 'package:flutterjc/plugin/OutLinePlugin.dart';
import 'package:flutterjc/plugin/PackageInfoPlugin.dart';
import 'package:flutterjc/plugin/PageViewPlugin.dart';
import 'package:flutterjc/plugin/PaginatedDataTablePlugin.dart';
import 'package:flutterjc/plugin/PopupmenuButtonPlugin.dart';
import 'package:flutterjc/plugin/RadioListTilePlugin.dart';
import 'package:flutterjc/plugin/RadioPlugin.dart';
import 'package:flutterjc/plugin/RichTextPlugin.dart';
import 'package:flutterjc/plugin/RouterPlugin.dart';
import 'package:flutterjc/plugin/RowPlugin.dart';
import 'package:flutterjc/plugin/ShardPlugin.dart';
import 'package:flutterjc/plugin/SlidePlugin.dart';
import 'package:flutterjc/plugin/SliverPlugin.dart';
import 'package:flutterjc/plugin/SnackPlugin.dart';
import 'package:flutterjc/plugin/SqlitePlugin.dart';
import 'package:flutterjc/plugin/StatePlugin.dart';
import 'package:flutterjc/plugin/StepperPlugin.dart';
import 'package:flutterjc/plugin/SwitchListTilePlugin.dart';
import 'package:flutterjc/plugin/SwitchPlugin.dart';
import 'package:flutterjc/plugin/TextFieldPlugin.dart';
import 'package:flutterjc/plugin/UrlLuanchPlugin.dart';
import 'package:flutterjc/plugin/WrapPlugin.dart';
import 'package:flutterjc/plugin/location/LocationPlugin.dart';
import 'package:flutterjc/plugin/map/MapPlugin.dart';
import 'package:flutterjc/plugin/provide/ProvideFactory.dart';
import 'package:flutterjc/plugin/third/RefreshPlugin.dart';
import 'package:provide/provide.dart';
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n_delegate.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provide/provide.dart';

void main() {
  var providers = Providers();
  providers
      .provide(Provider<ProvideFactory>.value(ProvideFactory.getInstance()));

  WidgetsFlutterBinding.ensureInitialized();
  runApp(ProviderNode(
    providers: providers,
    child: RouterWidget(),
  ));
}

/*
 * 功能：路由壳子
 * 需要传入的键：
 * 传入的值类型：
 * 传入的值含义：
 * 是否必传 ：
 * 作者：郑朝军 on 2019/4/7 23:23
 * 邮箱：1250393285@qq.com
 * 公司：武汉智博创享科技有限公司
 */
class RouterWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
//   AboutListTile(), 列表平铺
//   MaterialBanner(), banner
//   RawMaterialButton(),
//   InkWell(),
//   Scrollbar给滚动视图添加滚动条
//   ToggleButtons 创建一组水平的切换按钮。
//   Tooltip  轻量级点击提示
//   Tooltip  轻量级点击提示
//   ClipOval  圆形裁剪
    return new MaterialApp(
//      home: new ContainerPlugin(),
//      home: new ColumnPlugin(),
//      home: new RowPlugin(),
//      home: new AppBarPlugin(),
//      home: new RichTextPlugin(),
//      home: new PageViewPlugin(),
//      home: new SliverPlugin(),
//      home: new ListViewPlugin(),
//      home: new GridViewPlugin(),
//
//      home: new TextFieldPlugin(),
//      home: new FromPlugin(),
//      home: new SnackPlugin(),
//      home: new BottomAppBarPlugin(),
//      home: new OutLinePlugin(),
//      home: new ExpandPlugin(),
//
//      home: new ButtonBarPlugin(),
//      home: new PopupmenuButtonPlugin(),
//      home: new CheckboxPlugin(),
//      home: new CheckboxListTilePlugin(),
//      home: new RadioPlugin(),
//      home: new RadioListTilePlugin(),
//      home: new SwitchPlugin(),
//      home: new SwitchListTilePlugin(),
//      home: new SlidePlugin(),
//      home: new BottomSheetPlugin(),
//      home: new ExpansionPanelPlugin(),
//      home: new ChipPlugin(),
//      home: new ActionChipPlugin(),
//      home: new WrapPlugin(),
//      home: new DividerPlugin(),
//      home: new FilterChipPlugin(),
//      home: new ChooseChipPlugin(),
//      home: new InputChipPlugin(),
//      home: new DataTablePlugin(),
//      home: new PaginatedDataTablePlugin(),
//      home: new CardPlugin(),
//      home: new ClipRRectPlugin(),
//      home: new StepperPlugin(),

//      home: new DialogPlugin(),// bug
//      home: new RefreshPlugin(),
//      home: new IconFontPlugin(),
//      home: new RouterPlugin(),

//      home: new BlocPlugin(),
//      home: new LocalePlugin(),
//      home: new StatePlugin(),// bug
//      home: new ShardPlugin(),
//      home: new NotificationsPlugin(),
//      home: new SqlitePlugin(),

//      home: new AspectDPlugin(),// bug
//      home: new MapPlugin(),

//      home: new LocationPlugin(),
//      home: new HttpPlugin(),
//      home: new PackageInfoPlugin(),
//      home: new EventBusPlugin(),
//      home: new UrlLuanchPlugin(),
      home: new AliginPlugin(),
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        FlutterI18nDelegate(
            useCountryCode: true, fallbackFile: 'en', path: 'assets/locale'),
      ],
      supportedLocales: [
        const Locale('zh', 'CH'),
        const Locale('en', 'US'),
      ],
      locale: Locale("zh"),
    );
  }
}
